use clap::Parser;
use rust_collector::{bootstrap::run, cli::Cli, config::Config};

#[tokio::main]
async fn main() {
    let cli = Cli::parse();
    tracing_subscriber::fmt().with_max_level(tracing::Level::INFO).init();

    let cfg = Config::from_file(&cli.config).expect("failed to read config file");
    if let Err(err) = run(&cfg).await {
        eprintln!("Failed to run: {}", err);
    }
}
